import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

const Admin = resolve => require(['@/components/Admin'], resolve);
const Login = resolve => require(['@/components/Login'], resolve);
const SignUp = resolve => require(['@/components/SignUp'], resolve);
const Home = resolve => require(['@/components/Home'], resolve);
const Index = resolve => require(['@/components/Index'], resolve);
const GoodsList = resolve => require(['@/components/GoodsList'], resolve);

Vue.use(Router)


export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component:HelloWorld
    },
    {
      path: '/admin', //管理员
      name: 'Admin',
      component: Admin
    },
    {
      path: '/Login', // 登录
      name: 'Login',
      component: Login
    },
    {
      path: '/SignUp', // 登录
      name: 'SignUp',
      component: SignUp
    },
    {
      path:'/Home',
      name:'Home',
      component: Home
    },
    {
      path:'/Index',
      name:'Index',
      component: Index
    },
    {
      path:'/goodsList',
      name:'GoodsList',
      component: GoodsList
    },


  ]
});
